package com.bayair.doctor.mvp;

import com.bayair.doctor.net.DisposableManager;
import com.bayair.doctor.net.RxManager;
import com.bayair.doctor.net.services.Api;

import io.reactivex.disposables.Disposable;

public abstract class IModel {

    protected Api mApi;

    public IModel() {
        mApi = RxManager.getInstance().getApiService();
    }

    public void add(Disposable d) {
        DisposableManager.ins().onSubscribe(this.getClass().getSimpleName(), d);
    }

    public void destroy() {
        DisposableManager.ins().dispose(this.getClass().getSimpleName());
    }
}
